package com.ding.service.impl;

import com.ding.dao.BookMapper;
import com.ding.pojo.Books;
import com.ding.service.BookService;
import org.mybatis.spring.support.SqlSessionDaoSupport;

import java.util.List;

/**
 * BookServiceImpl
 *
 * @author DYS
 * @date 2021/7/5
 * @time 10:59
 * @Description
 */
public class BookServiceImpl implements BookService {

	//service调用dao层
	private BookMapper bookMapper;

	public void setBookMapper(BookMapper bookMapper) {
		this.bookMapper = bookMapper;
	}

	@Override
	public int insertOneBook(Books book) {
		return bookMapper.insertOneBook(book);
	}

	@Override
	public int deleteOneBook(int bookID) {
		return bookMapper.deleteOneBook(bookID);
	}

	@Override
	public int updateOneBook(Books book) {
		return bookMapper.updateOneBook(book);
	}

	@Override
	public Books selectOneBook(int bookID) {
		return bookMapper.selectOneBook(bookID);
	}

	@Override
	public List<Books> selectAllBooks() {
		return bookMapper.selectAllBooks();
	}

	@Override
	public List<Books> selectLimitBook(String bookName) {
		return bookMapper.selectLimitBook(bookName);
	}
}
